using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using OgilvyOne.Model;
using OgilvyOne.BLL;
using OgilvyOne.IDAL;

namespace OgilvyOne.ProcessFlow
{
    public class AssetController
    {
        // Methods
        public bool CreateAsset(AssetInfo assetinfo)
        {
            try
            {
                new AssetClass().Insert(assetinfo);
            }
            catch
            {
                return false;
            }
            return true;
        }

        public bool CreateAsset(AssetInfo assetinfo, int menuId)
        {
            try
            {
                AssetClass class2 = new AssetClass();
                class2.Insert(assetinfo);
                class2.InsertAssetMenu(assetinfo, menuId);
            }
            catch
            {
                return false;
            }
            return true;
        }

        public AssetInfo getAssetInfo(int asset_id)
        {
            AssetClass class2 = new AssetClass();
            return class2.getAssetInfo(asset_id);
        }

        public void UpdateAsset(AssetInfo assetInfo)
        {
            new AssetClass().Update(assetInfo);
        }

        public void UpdateAssetAndMenuAsset(AssetInfo assetInfo, int menuId)
        {
            AssetClass class2 = new AssetClass();
            class2.Update(assetInfo);
            class2.UpdateMenuAsset(assetInfo.Asset_ID, menuId);
        }

    }
}
